#include "Settings.h"
#include <assert.h>
GLint gRank = 0;
GLint numProc = 0;
GLint tileX = 0;
GLint tileY = 0;
string runPath = "";
CaptureMode capMode = None;

string GetCurentFullPath(char *path)
{
	string fullPath = runPath + path;
	return fullPath;
}


//#ifdef SEAMLESS_PROJECTION
// for seamless projection
double gScale = 1.;
double gDeltaX = 0.;
double gDeltaY = 0.;
//#endif	// SEAMLESS_PROJECTION

GLint gControlRank0 = 1;
GLint gControlRank1 = 3;

float gDeltaWallFish = 30.0f;
bool  gEnableMockXtionPro = false;

bool getFishColourFromTexturePathName(const char *texturePath,const char*colourName)
{
	assert(texturePath);
	assert(colourName);
	char *p=(char*)texturePath;
	char *end = NULL;
	char token='/';
	int count = 0;
	const char *q = colourName;
	std::string buffer;
	while ((end = strchr(p,token))!=NULL)
	{
		p=p+1;
	}
	buffer = std::string(p);
    return (buffer.compare(q)==0||buffer.compare(q)>0)?true:false;
}

int split_string(const char *src, char token, std::vector<std::string> &vec_result)
{
	assert(src != NULL);

	char *start = (char *)src;
	char *end = NULL;
	int count = 0;

	while ( (end = strchr(start, token)) != NULL )
	{
		if ( end != start )
		{
			std::string buffer(start, end - start);
			vec_result.push_back(buffer);
			++count;
		}

		start = end + 1;
	}
	vec_result.push_back(std::string(start));
	return count;
}